 #coding: utf-8
from marshmallow import Schema, fields
from model.model_base import Base
from sqlalchemy import Column, String, Integer,DateTime


class WorkrecordConfirm(Base):
    # 项目部确认工作量
    __tablename__ = 'v_workrecord_confirm'
    bureauid = Column(String(2), primary_key=True, comment='供电局编号')
    bureauname = Column(String(50), nullable=True, comment='供电局名称')
    total_amount= Column(Integer, nullable=True, comment='登记总数量')
    confirm_amount = Column(Integer, nullable=True, comment='确认数量')
    unconfirm_amount = Column(Integer, nullable=True, comment='未确认数量')
    mintime = Column(DateTime, nullable=True, comment='未处理最早时间')


class WorkrecordConfirmSchema(Schema):
    bureauid = fields.String()
    bureauname = fields.String()
    total_amount = fields.Integer()
    confirm_amount = fields.Integer()
    unconfirm_amount = fields.Integer()
    mintime = fields.DateTime(format="%Y-%m-%d %H:%M:%S.%f")

workrecordConfirmSchema = WorkrecordConfirmSchema()
